﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LuceneManager;
using System.IO;
using Notifying.Properties;
using Common;

namespace Notifying
{
    public partial class NotifierUI : Form
    {
        public const int REALTIME_NOTIFY_INTERVAL = 5;
        public const int HOURLY_NOTIFY_INTERVAL = 60;
        Notifier _notifier;

        public NotifierUI()
        {
            InitializeComponent();
            _notifier = new Notifier(HOURLY_NOTIFY_INTERVAL, REALTIME_NOTIFY_INTERVAL,
             Settings1.Default.PrefixFilePath, LoadIndexNodes());
        }

        public static List<IndexNode> LoadIndexNodes()
        {
            IndexNodes nodes = new IndexNodes();
            nodes = XmlClassHandler<IndexNodes>.Load(Settings1.Default.IndexNodesFilePath);
            return nodes.Nodes;
        }

        private void button1_Click(object sender, EventArgs e)
        { 
            _notifier.StartNotificationTimers();
        }


    }
}
